package main

import (
	"context"
	"fmt"
	"google.golang.org/grpc"
	"qq_service/end_email/protobuf/pb"
)

func SendMail(QQpath []string, Word string, Email string) string {
	const Address = "127.0.0.1:5000"
	conn, err := grpc.Dial(Address, grpc.WithInsecure())
	if err != nil {
		fmt.Println(err)
	}
	defer conn.Close()

	c := pb.NewSendMailServiceClient(conn)
	req := &pb.QqListRequest{QqPath: QQpath, Email: Email, Word: Word}
	res, err := c.SendMail(context.Background(), req)
	if err != nil {
		fmt.Println(err)
	}
	//fmt.Println("收到",res.Isok)
	return res.IsOk

}
